{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from psikit import Psikit\n",
    "from rdkit import Chem\n",
    "from rdkit.Chem.Draw import IPythonConsole\n",
    "from IPython.display import SVG\n",
    "from rdkit.Chem.Draw import rdMolDraw2D"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "pk = Psikit()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Optimizer: Optimization complete!\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'Electrostatic Potential Charges': array([-0.3384504 ,  0.9525741 , -0.85518224, -0.86392646,  0.0387593 ,\n",
       "         0.03824675,  0.02797894]),\n",
       " 'Restrained Electrostatic Potential Charges': array([-0.19605235,  0.87815436, -0.83637101, -0.84554228,  0.00486571,\n",
       "         0.00417476, -0.00922919])}"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pk.read_from_smiles(\"CC(=O)[O-]\")\n",
    "pk.optimize()\n",
    "pk.resp_charge"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg baseProfile=\"full\" height=\"200px\" version=\"1.1\" width=\"400px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<rect height=\"200\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"400\" x=\"0\" y=\"0\"> </rect>\n",
       "<path d=\"M 156.311,105.956 237.204,102.646\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 105.261,114.073 95.4988,116.777\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 126.81,99.5001 93.774,37.1813\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 126.626,114.5 94.5235,172.374\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 256.542,112.579 271.68,143.521\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 271.68,143.521 286.817,174.463\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 270.259,105.869 285.396,136.811\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 285.396,136.811 300.534,167.753\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 264.318,94.2238 284.684,60.9251\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 284.684,60.9251 305.05,27.6264\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#000000\" x=\"105.261\" y=\"114.5\"><tspan>-0.196</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#000000\" x=\"237.204\" y=\"109.224\"><tspan>0.878</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"271.819\" y=\"186.108\"><tspan>-0.836</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"284.111\" y=\"27.6264\"><tspan>-0.846</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#000000\" x=\"95.4988\" y=\"118.036\"><tspan>0.005</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#000000\" x=\"67.2712\" y=\"37.1813\"><tspan>0.004</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#000000\" x=\"64.8381\" y=\"187.374\"><tspan>-0.009</tspan></text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "drawer = rdMolDraw2D.MolDraw2DSVG(400,200)\n",
    "opts = drawer.drawOptions()\n",
    "\n",
    "for i, atom in enumerate(pk.mol.GetAtoms()):\n",
    "    opts.atomLabels[i] = \"{0:.3f}\".format(float(atom.GetProp(\"RESP_C\")))\n",
    "\n",
    "drawer.DrawMolecule(pk.mol)\n",
    "drawer.FinishDrawing()\n",
    "svg = drawer.GetDrawingText().replace('svg:','')\n",
    "SVG(svg)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "pk.read_from_smiles(\"CC1=NN=N[N-]1\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAIAAADCEh9HAAAABmJLR0QA/wD/AP+gvaeTAAAdc0lEQVR4nO3deUBUVf8G8GeGQRZlExFQXHJHDBdMUTCXcinRN9RQcSclgWHJ3TfNNBeQSEAQBQ0hKQVzCUxyoVL5ZRq8ai6vqKmIgiIiIJsMM78/Zl7AHe4sZ5bv5y+6eC+PlY/nzrn3HJ5EIgEhhBCu+KwDEEKIZqMaJYQQuVCNEkKIXKhGCXklc3PweMjIeOagszOGDAGA0FC4uMDFBadPM0lH1IWAdQBC1Jd0/tXXFxcuoFmz+oPS40OGoHVrAGjXjlE+oh6oRgl5g6tXERKClSufP+7sDGdnFoGImqGbekJeZ+pU9OiB9etx40b9QXpKkDRENUrI6xgYIC4O1dUQCllHIeqKapSQN3B1hY8P0tORkvLyX3DiBPr3R2wsqqpUm4yoB6pRQt4sOBjt2iEoCGVlL/nujh3IysKnn6JTJ6xejYIClecjTFGNEvJmJiaIicG9ey+ZaAKwbRsSEuDoiPx8fPklOnSAhweOHVN5SsII1SghjTJ2LKZORVQULl9+/luGhpg5E+fP46+/MGMGxGKkpGDkSDg5ITYWlZUs4hIVoholpLEiImBujidPXvkLnJyQmIjcXKxaBSsrZGfj00/RsSOWLcPt2yoMSlSLapSQl3jyBBs2gMcDj1d/0MoK4eEAnjn4IltbfPkl7txBcjIGDcKDBwgJQadOGDcOx47Rw1JaiEcL5RHyoqlTsXs3vLywY4e8l8rKQkQEdu9GTQ0A9OiB+fMxdy6aN5c/JlELVKOEPC8yEoGBaNECZ87A3l4x1ywoQEICoqKQlwcAZmaYNQtBQXjrLcVcnzBENUrIM/78E+++i5oaJCdj0iQFX/zpUxw8iNhY2Tw+n48RIxAQADe3N3xQQNQZ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26cL/I69/OdHGhxzy1E9UoIQBQUgJTUy41V1GB48eRloZDh+rfzjQ2xuDBcHPDpElo21axSYnaoRolhItbt3DkCFJTcfQoqqtlBzt2xKhRcHPDqFEwMGCaj6gQ1SghMm/cvb22FufOyWbb6xb20tNDnz70dqZOoykmQmTqdm+/cKH+lSHp7u05OVi9Gunp9TtwWFhg9Gi4uWHMGG3beJk0FdUoIc+Q7t7+3KYahob4/nugwWOe775Lb2cSGbqpJ0TGzAxjx+I//8GtW7h4EZ07A8DAgRAIkJmJnTvh6irXPD7RVlq3GQ0hcnjN7u2zZ1OHkpejGiXkGbR7O2kqqlFCnke7t5MmoRol5Hm0eztpEqpRQl6ibvf2umVACXkVqlFCXi4iAubmePKEdQ6i9qhGCZF56e7t0uOEvMb/A4dCeTOlt5e1AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x1217a4da0>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pk.mol"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Optimizer: Optimization complete!\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'Electrostatic Potential Charges': array([-0.98211149,  1.18464533, -0.67803762, -0.21994535, -0.19810641,\n",
       "        -0.6954824 ,  0.19644875,  0.19970103,  0.19288816]),\n",
       " 'Restrained Electrostatic Potential Charges': array([-0.78229709,  1.09017898, -0.65778538, -0.22054976, -0.19647406,\n",
       "        -0.67770262,  0.14870634,  0.15198418,  0.1439394 ])}"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pk.optimize()\n",
    "pk.resp_charge"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg baseProfile=\"full\" height=\"200px\" version=\"1.1\" width=\"400px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<rect height=\"200\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"400\" x=\"0\" y=\"0\"> </rect>\n",
       "<path d=\"M 121.004,92.795 171.042,95.6911\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 90.0741,83.8176 75.0871,63.0195\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 90.5065,83.8176 78.0035,64.9577\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 92.2698,98.8176 70.6815,149.277\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 197.977,104.495 215.464,134.255\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 215.464,134.255 232.951,164.015\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 220.201,103.446 232.442,124.278\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:6,6\"/>\n",
       "<path d=\"M 232.442,124.278 244.684,145.11\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:6,6\"/>\n",
       "<path d=\"M 199.357,89.4949 220.003,62.7399\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 220.003,62.7399 240.649,35.9848\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 221.141,93.4991 235.593,74.7705\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:6,6\"/>\n",
       "<path d=\"M 235.593,74.7705 250.045,56.042\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:6,6\"/>\n",
       "<path d=\"M 262.884,164.038 295.194,154.573\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 262.194,143.72 284.811,137.094\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:6,6\"/>\n",
       "<path d=\"M 321.188,139.596 325.498,70.7094\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 302.18,128.033 305.197,79.8128\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:6,6\"/>\n",
       "<path d=\"M 308.789,55.7094 263.614,35.9848\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 294.133,70.7982 262.51,56.991\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:6,6\"/>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#000000\" x=\"69.9533\" y=\"98.8176\"><tspan>-0.782</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#000000\" x=\"171.042\" y=\"104.495\"><tspan>1.090</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"211.833\" y=\"179.015\"><tspan>-0.658</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"295.194\" y=\"154.596\"><tspan>-0.221</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"300.442\" y=\"70.7094\"><tspan>-0.196</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"220.911\" y=\"35.9848\"><tspan>-0.678</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#000000\" x=\"47.1557\" y=\"63.0195\"><tspan>0.149</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#000000\" x=\"50.5045\" y=\"64.9577\"><tspan>0.152</tspan></text>\n",
       "<text style=\"font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#000000\" x=\"44.9457\" y=\"164.277\"><tspan>0.144</tspan></text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "drawer = rdMolDraw2D.MolDraw2DSVG(400,200)\n",
    "opts = drawer.drawOptions()\n",
    "\n",
    "for i, atom in enumerate(pk.mol.GetAtoms()):\n",
    "    opts.atomLabels[i] = \"{0:.3f}\".format(float(atom.GetProp(\"RESP_C\")))\n",
    "\n",
    "drawer.DrawMolecule(pk.mol)\n",
    "drawer.FinishDrawing()\n",
    "svg = drawer.GetDrawingText().replace('svg:','')\n",
    "SVG(svg)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
